package com.mall.ibatis.bean;

import java.io.Serializable;

import com.mall.util.StringUtil;
import com.thoughtworks.xstream.XStream;

public class FunctionMethod implements Serializable,ICell{
	/**
	 * 功能方法勾选属性
	 */
	private String methodId;
	private String functionId;
	private String roleId;
	
	/**
	 * 功能方法一对多关系属性
	 */
	private String functionMethodId;
	private String functionMethodName;
	private String methods;
	
	public String getFunctionMethodId() {
		return functionMethodId;
	}
	public void setFunctionMethodId(String functionMethodId) {
		this.functionMethodId = functionMethodId;
	}
	public String getFunctionMethodName() {
		return functionMethodName;
	}
	public void setFunctionMethodName(String functionMethodName) {
		this.functionMethodName = functionMethodName;
	}
	public String getMethods() {
		return methods;
	}
	public void setMethods(String methods) {
		this.methods = methods;
	}
	public String getRoleId() {
		return roleId;
	}
	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}
	public String getMethodId() {
		return methodId;
	}
	public void setMethodId(String methodId) {
		this.methodId = methodId;
	}
	public String getFunctionId() {
		return functionId;
	}
	public void setFunctionId(String functionId) {
		this.functionId = functionId;
	}
	public String getCellID() {
		return StringUtil.null2Empty(functionMethodId);
	}

	public String toCell() {
		StringBuffer cellBuffer  = new StringBuffer();
		cellBuffer.append("<functionMethodId><![CDATA[" + StringUtil.null2Empty(functionMethodId)+"]]></functionMethodId>");
		cellBuffer.append("<functionMethodName><![CDATA[" + StringUtil.null2Empty(functionMethodName)+"]]></functionMethodName>");
		cellBuffer.append("<methods><![CDATA[" + StringUtil.null2Empty(methods)+"]]></methods>");
		return cellBuffer.toString();
	}

	public String toXML() {
		XStream xStream = new XStream();
		xStream.alias(this.getClass().getSimpleName(),this.getClass());
		return xStream.toXML(this);
	}
	
}
